package com.mkz.producer.feign.factory;

import org.springframework.stereotype.Component;

import com.mkz.producer.feign.ProducerClient;
import com.mkz.producer.feign.fallback.ProducerServiceFallback;

import feign.hystrix.FallbackFactory;

/**
 * ClassName: ProducerServiceFallbackFactory 
 * @Description: Kafka消息发送
 * @author: KuangJianyu
 * @date: 2020年4月16日
 */
@Component
public class ProducerServiceFallbackFactory  implements FallbackFactory<ProducerClient> {

	@Override
	public ProducerClient create(Throwable throwable) {
		ProducerServiceFallback producerServiceFallback = new ProducerServiceFallback();
		producerServiceFallback.setCause(throwable);
		return producerServiceFallback;
	}
}
